<include file="Public:header" />
<div class="subnav">
  <div class="explain-col" style="position: relative;">
    <form name="searchForm" id="searchForm" method="GET" action="__ACTION__">
      统计分析：
      <select name="year" id="year" onchange="searchForm.submit();">
            <option value="2013" selected="selected">2013年</option>
            <option value="2012" <eq name="Think.get.year" value="2012"> selected="selected"</eq> />2012年</option>
      </select>
      <select name="month" id="month" onchange="searchForm.submit();">
      		<volist name="monthArr" id="vo">
            	<option value="{$vo}" <eq name="Think.get.month" value="$vo"> selected="selected"</eq> >{$vo}月</option>
            </volist>
      </select>
      <span id="searchTime" style="display:none;">
      从：<input type="text" class="input-text Wdate" size="20" name="startTime" id="startTime" value="" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="readonly" />
      到&nbsp;<input type="text" class="input-text Wdate" size="20" name="endTime" id="endTime" value="" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="readonly" />
      </span>  
      <eq name="_SESSION['roleId']" value="1">
      <select name="userId" id="userId" onchange="searchForm.submit();" >
            <option value="0" selected="selected">请选择用户</option>
            <volist name="userList" id="vo">
            <option value="{$vo.id}" <eq name="Think.get.userId" value="$vo.id"> selected="selected"</eq> />{$vo.username}</option>
            </volist>
      </select>
      </eq>
      <input type="submit" value=" 搜索 " class="button" />
    </form>
      <div class="content-menu" style="position: absolute; right: 30px;top: 5px;">
        <a href="javascript:openWinBox('__URL__/statisticsColumn/year/{$Think.get.year}/month/{$Think.get.month}','柱型图',980,600)" class="add fb" ><em>统计图</em></a>
      </div>
  </div>
</div>
<!--subnav-->
<div class="pad-lr-10">
  <form name="myform" id="myform" action="__URL__/deleteAll" method="GET">
    <div class="table-list">
    <table width="100%" cellspacing="0">
      <thead>
        <tr>
          <th align="center" colspan="{$colspan}" style="font-size:18px; color:#009; font-weight:bolder; ">{$title}</th>
          
        </tr>
      </thead>
      <tbody  id="list">
      	<tr>
            <td align="left" width="40">日期</td>
            <volist name="dayArr" id="vo">
            <td align="center">{$vo}</td>
            </volist>
            <td align="center">总数</td>
        </tr>
        <tr style="font-size:10px;">
            
            <td align="left" style="font-size:12px;">星期</td>
            <volist name="weekList" id="vo">
            <td align="center">{$vo}</td>
            </volist>
            <td align="center"></td>
        </tr>
        <tr>
            <td align="left">电话量</td>
            <volist name="consultNum" id="vo">
            <td align="center" class="tjbg consultNum" style="color:#F00">{$vo}</td>
            </volist>
             <td align="center" ><b style="color:#F00">{$consultNum|array_sum}</b></td>
        </tr>
      
      </tbody>
    </table>
    <div class="btn">
    	<span style="margin-right:10px; color:#000">单位：（个）</span>  电话量：根据搜索当前月份的电话量。
    </div>
  </form>
</div>

</body>
</html>
<script type="text/javascript" src="__PUBLIC__/Js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
$(function(){
	//赋予状态颜色
	$(".status").each(function(i, val) {
        var status = $(this).attr('name');
		if(status==1){
			$(this).addClass('blue');
		}else{
			$(this).addClass('red');
		}
    });
	
	$('.tjbg:odd').css("background-color", "#F4F4F8");
	$('.tjbg:even').css("background-color", "#EFF1F1");
	
	$('#myform').ajaxForm({
		beforeSubmit:  checkForm,
		success:       complete,
		dataType: 'json'
	});
	function checkForm(){
		var len = $("input[name='spaceid[]']:checked").length;
		if(len < 1){
			msg('请先选择删除项！','warning',3);
			return false;
		}
	}
	
	var origin = $.artDialog.open.origin;
	function complete(data){
		msg(data.info,data.data);
		if(data.status) setTimeout(function(){origin.location.reload();},1500);
	}
	
	
	var searchType = "{$Think.get.searchType}";
	if(searchType==5){
		$("#searchTime").show();
	}else{
		$("#searchTime").hide();
	}
	$("#searchType").change(function(){
		var searchType = $(this).val();
		if(searchType==5){
			$("#searchTime").show();
			return false;
		}
		searchForm.submit();
	})
	
	var startTime = "{$Think.get.startTime}";
	var endTime = "{$Think.get.endTime}";
	if(startTime!=''){
		$("#startTime").val(startTime);
	}
	if(endTime!=''){
		$("#endTime").val(endTime);
	}
	
	
})
	
function exportExcel(){
	var box = $("input[name='idArr[]']:checked");
		len = box.length,
		idArr = "";
	for (var i = 0; i < box.length; i++){
		idArr += box[i].value + ",";
	}
	location.href="__APP__/Excel/exportExcel/idArr/"+idArr;
}

//修改状态
function changeStatus(id){
	var statusId = $("#status-"+id).attr('name');
	$.get("__URL__/changeStatus/id/"+id+"/statusId/"+statusId, function(data) {
	if(statusId==1){
			$("#status-"+id).text('禁用');
			$("#status-"+id).attr('name',0);
			$("#status-"+id).attr('class','red');
		}else{
			$("#status-"+id).text('启用');
			$("#status-"+id).attr('name',1);
			$("#status-"+id).attr('class','blue');
		}				  
	});
}
</script>